<?php
/*
* Author: Nguyen Hai Nam
* Module: NewsMedia
* Desc	: Something news hot
* Date	: 24/06/2012
*/
class NewsMediaModule extends Pick_Core_Module{
	
	function NewsMediaModule(){
		
		parent::Pick_Core_Module();
		//$this->pushJS();
		//$this->pushCSS();
		# Languages
		$languages = new Pick_Core_Languages();
		$objectLanguages = "";
		$objectLanguages = $languages->getObjects(1, 'status = 1', array('position'=>'ASC'), '');
		if($objectLanguages){
			$objectLanguages = $objectLanguages['data'];	
		}#endif
		$this->template->assign("objectLanguages", $objectLanguages);
	}
	public function getContent(){

		$newscategory 	= new Pick_Dao_NewsCategory();
		$news = new Pick_Dao_News();
		$id = $this->request->get('id');
		$objCategory = $newscategory->getObject($id);
		$arrNews = "";
        $backgroundimage = "";
		if(is_object($objCategory)){
			$arrNews = $news->getObjectsFromCId(1, $objCategory->getField('id'));
            $backgroundimage = $objCategory->getFullUrlBackGround();
		}
        $this->template->assign('backgroundimage', $backgroundimage);
		$this->template->assign("arrNews", $arrNews);
	}
}